<fieldset id="additional-parameters">
  <legend title="<%= t '.tooltip.additional_parameters' %>"><%= t '.title' %></legend>
  <ol>
    <li>
      <%= form.label(:measurement_error, t('.measurement_error'), :title => t('.tooltip.measurement_error')) %>
      <%= form.text_field(:measurement_error, :title => t('.tooltip.measurement_error')) %>
      <%= form.radio_button(:error_units, :mDa, :checked => true, :title => t('.tooltip.mda')) %>
      <%= form.label(:error_units_mda, t('.mda'), :title => t('.tooltip.mda')) %>
      <%= form.radio_button(:error_units, :ppm, :title => t('.tooltip.ppm')) %>
      <%= form.label(:error_units_ppm, t('.ppm'), :title => t('.tooltip.ppm')) %>
    </li>

    <li>
      <%= form.label(:intensity_threshold, t('.intensity_threshold'), :title => t('.tooltip.intensity_threshold')) %>
      <%= form.text_field(:intensity_threshold, :title => t('.tooltip.intensity_threshold')) %>
    </li>

    <li>
      <%= form.label(:cuts, t('.cuts'), :title => t('.tooltip.measurement_error')) %>
      <%= form.text_field(:cuts, :title => t('.tooltip.cuts')) %>
    </li>

    <li>
      <fieldset>
        <legend title="<%= t '.tooltip.rr' %>"><%= t '.rr' %></legend>
        <%= form.radio_button(:rr, 0, :title => t('.tooltip.rr_no')) %>
        <%= form.label(:rr_false, t('generic._no'), :title => t('.tooltip.rr_no')) %>
        <%= form.radio_button(:rr, 1, :title => t('.tooltip.rr_yes')) %>
        <%= form.label(:rr_true, t('generic._yes'), :title => t('.tooltip.rr_yes')) %>
      </fieldset>
    </li>

    <li id="description">
      <%= form.label(:description, t('.description'), :title => t('.tooltip.description')) %>
      <%= form.text_field(:description, :title => t('.tooltip.description')) %>
    </li>

    <li>
      <%= form.label(:ms_file, t('.peaks'), :title => t('.tooltip.peaks')) %>
      <%= form.text_area(:ms_file, :size => "15x9", :title => t('.tooltip.peaks')) %>
      <div id="linenumber"> </div>
    </li>

  </ol>
</fieldset>

<% content_for :javascript do %>
$(document).ready(function() {
  $("#job_ms_file").bind("keypress keydown change", function() {
    var peaks = $.grep($("#job_ms_file").val().split("\n"), function(line) {
      return line.match(/^(\s*\d+[,.]?\d*\s+\d+[,.]?\d*\s*)+$/) != null;
    }).length;
    $("#linenumber").text(peaks + " valid peaks");
  });
});
<% end %>
